package enumdemo;

public class Test2
{
    public static void main(String[] args)
    {
        //目标：掌握枚举类的应用场景：做信息的分类和标志
        //常量:使用了static final修饰的变量
        move(Constant.UP);
        move2(direction.RIGHT);
    }
    public static void move(int direction)
    {
        switch(direction)
        {
            case Constant.UP:
                System.out.println("向上移动");
                break;

            case Constant.DOWN:
                System.out.println("向下移动");
                break;

            case Constant.LEFT:
                System.out.println("向左移动");
                break;

            case Constant.RIGHT:
                System.out.println("向右移动");
                break;
        }
    }

    public static void move2(direction dir)
    {
        switch(dir)
        {
            case UP:
                System.out.println("向上移动");
                break;

            case DOWN:
                System.out.println("向下移动");
                break;

            case LEFT:
                System.out.println("向左移动");
                break;

            case RIGHT:
                System.out.println("向右移动");
                break;
        }

    }
}
